//
//  OCJSHelper.m
//  Yanwei
//
//  Created by 刘文 on 17/6/9.
//  Copyright © 2017年 DCloud. All rights reserved.
//

#import "OCJSHelper.h"
#import "NSString+Util.h"

@interface OCJSHelper() {
    BOOL _couldSendRequest;
}

@property (nonatomic, weak) DeepestViewController *vc;
@property (nonatomic, strong) NSDictionary * tempDicData;
@property (nonatomic, assign) BOOL notAllowedToClick; // 不允许点击

@end

@implementation OCJSHelper

- (instancetype)initWithDelegate:(id<OCJSHelperDelegate>)delegate vc:(DeepestViewController *)vc; {
    if (self = [super init]) {
        self.delegate = delegate;
        self.vc = vc;
        _couldSendRequest = YES;
    }
    return self;
}

- (void)dealloc {
    NSLog(@"%@, %s", self.class, __func__);
}

- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    NSDictionary *dic = [NSDictionary dictionaryWithDictionary:message.body];
    NSString * functionName = [dic valueForKey:@"functionName"];
    NSLog(@"JS交互参数：%@", dic);
  
}

@end
